6f8cba
@@ -241,8 +241,12 @@
public class FileConsumer extends GenericFileConsumer<File> {
 
     @Override
     protected void updateFileHeaders(GenericFile<File> file, Message message) {
-        long length = file.getFile().length();
-        long modified = file.getFile().lastModified();
+        File upToDateFile = file.getFile();
+        if (fileHasMoved(file)) {
+            upToDateFile = new File(file.getAbsoluteFilePath());
+        }
+        long length = upToDateFile.length();
+        long modified = upToDateFile.lastModified();
         file.setFileLength(length);
         file.setLastModified(modified);
         if (length >= 0) {
@@ -257,4 +261,9 @@
public class FileConsumer extends GenericFileConsumer<File> {
     public FileEndpoint getEndpoint() {
         return (FileEndpoint) super.getEndpoint();
     }
+
+    private boolean fileHasMoved(GenericFile<File> file) {
+        // GenericFile's absolute path is always up to date whereas the underlying file is not
+        return !file.getFile().getAbsolutePath().equals(file.getAbsoluteFilePath());
+    }
 }
